<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
echo JhtraqHelper::drawTabs($this->project->slug);
?>
<p></p>
<div class="componentheading">
<?php echo $this->project->name; ?> - <?php echo JText::_('COM_JHTRAQ_SVN_LOG');?> <?php echo JText::_('COM_JHTRAQ_REVISION');?><?php echo $this->v;?>

</div>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<thead>
<tr>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_REV');?></th>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_DATE');?></th>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_AUTHORS');?></th>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_ADDED');?></th>
<td class="sectiontableheader"><?php echo JText::_('COM_JHTRAQ_MODIFIED');?></th>
</tr>	
</thead>
<tbody>
<?php
$r = 0;
$link = 'index.php?option=com_jhtraq&view=svn&project='.$this->project->slug.'&action=display';
// foreach($this->logs as $log)
$log = $this->logs[0];
{
	?>
	<tr class="sectiontableentry<?php echo $r + 1; ?>">
	<td><?php echo $log['version'];?></td>
	<td><?php echo DATE(JText::_('COM_JHTRAQ_DATE_FORMAT'), strtotime($log['date']));?></td>
	<td><?php echo $log['author']?></td>
	<td><?php echo (int)count(@$log['add_files'])?></td>
	<td><?php echo (int)count(@$log['mod_files'])?></td>
	</tr>
	<?php
	$r = 1-$r;
}
?>

</tbody>

</table>
<h3><?php echo JText::_('COM_JHTRAQ_COMMENT');?></h3>
<p><?php echo $this->svnLogParse($log['comment']);?></p>

<?php if(count(@$log['add_files']))
{?>
<h3><?php echo JText::_('COM_JHTRAQ_FILES_ADDED');?></h3>
<ol>
<?php 
foreach($log['add_files'] as $file)
{
	if($this->canview)
	{
		?>
		<li><a href="<?php echo JRoute::_($link . '&path='.$file);?>"><?php echo $file;?></a> <a href="<?php echo JRoute::_('index.php?option=com_jhtraq&view=svn&project='.$this->project->slug.'&action=diff&path='.$file);?>"><?php echo JText::_('COM_JHTRAQ_DIFF');?></a> </li>
		<?php
	}else{
	?>
	<li><?php echo $file;?></li>
	<?php
	}
}
?>
</ol>
<?php
}
?>

<?php if(count(@$log['mod_files']))
{?>
<h3><?php echo JText::_('COM_JHTRAQ_FILES_MODIFIED');?></h3>
<ol>
<?php 
foreach($log['mod_files'] as $file)
{
	if($this->canview)
	{
		?>
		<li><a href="<?php echo JRoute::_($link . '&path='.$file);?>"><?php echo $file;?></a> <a href="<?php echo JRoute::_('index.php?option=com_jhtraq&view=svn&project='.$this->project->slug.'&action=diff&path='.$file.'&version='.$this->v);?>"><?php echo JText::_('COM_JHTRAQ_DIFF');?></a> </li>
		<?php
	}else{
		?>
		<li><?php echo $file;?></li>
		<?php
	}
}
?>
</ol>
<?php
}
?>
